<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>迅腾报表后台管理</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="__WZHADMIN__assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="__WZHADMIN__assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="__WZHADMIN__assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="__WZHADMIN__assets/css/admin.css">
    <link rel="stylesheet" href="__WZHADMIN__assets/css/app.css">
</head>

<body data-type="generalComponents">

{include file='Public:header'}

{include file='Public:menu'}




        <div class="tpl-content-wrapper">

            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">首页</a></li>
                <li><a href="{:url('admin/Bonus/index')}">奖金管理</a></li>
                <li class="am-active">奖金管理</li>
            </ol>
            <div class="tpl-portlet-components">

                <div class="tpl-block ">

                    <div class="am-g tpl-amazeui-form">

                        <div class="am-u-sm-12 am-u-md-9">
                            <form class="am-form am-form-horizontal">
                                <input type="hidden" id="id"  name="id" value="{$res.id}" readonly>

                                <div class="am-form-group">
                                    <label for="order" class="am-u-sm-2 am-form-label">工程编号</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="order" name="order" placeholder="请输入工程编号" value="{$res.order}" readonly>
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="title" class="am-u-sm-2 am-form-label">标题</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="title" name="title" placeholder="请输入标题" value="{$res.title}" readonly>
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="income" class="am-u-sm-2 am-form-label">项目收入</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="income" name="income" placeholder="请输入项目收入" value="{$res.income}">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="material" class="am-u-sm-2 am-form-label">物料支出</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="material" name="material" placeholder="请输入物料支出资金" value="{$res.material}">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="personnel" class="am-u-sm-2 am-form-label">劳务支出</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="personnel" name="personnel" placeholder="请输入劳务支出资金" value="{$res.personnel}">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="tax" class="am-u-sm-2 am-form-label">税收支出</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="tax" name="tax" placeholder="请输入税收支出" value="{$res.tax}">
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="capital" class="am-u-sm-2 am-form-label">占用资金</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="capital" name="capital" placeholder="请输入占用资金" value="{$res.capital}">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="risk" class="am-u-sm-2 am-form-label">风险金支出</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="risk" name="risk" placeholder="请输入风险金支出" value="{$res.risk}">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="develop" class="am-u-sm-2 am-form-label">发展金支出</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="develop" name="develop" placeholder="请输入风险金支出" value="{$res.develop}">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="percent" class="am-u-sm-2 am-form-label">奖金占比</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="percent" name="percent" placeholder="请输入奖金占比" value="{$res.percent}">
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <div class="am-u-sm-9 am-u-sm-push-3">
                                        <button type="button" class="am-btn am-btn-primary" onclick="send()">保存</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>










        </div>

    </div>


    <script src="__WZHADMIN__assets/js/jquery.min.js"></script>
    <script src="__WZHADMIN__assets/js/amazeui.min.js"></script>
    <script src="__WZHADMIN__assets/js/app.js"></script>
    <script>
        function send() {
            $data= {
                'id':$('#id').val(),
                'income':$('#income').val(),
                'material':$('#material').val(),
                'personnel':$('#personnel').val(),
                'tax':$('#tax').val(),
                'capital':$('#capital').val(),
                'risk':$('#risk').val(),
                'develop':$('#develop').val(),
                'percent':$('#percent').val(),
            }



            $.ajax({
                type:"post",
                url:"{:url('admin/Bonus/doEdit')}",
                async:true,
                data:$data,
                dataType:'json',
                success(xhr){
                    alert(xhr.msg)
                    if (xhr.code==1)
                    {
                        window.location.href="{:url('admin/bonus/index')}"
                    }
                }
            });


        }
    </script>

</body>

</html>